<template>
	<view>
		<!-- 自定义导航栏 -->
		<view class="navBarBox"  :style="{'background':type==1?'rgba(0,0,0,0)':type}">
			<!-- 状态栏占位 -->
			<view class="statusBar" :style="{ paddingTop: statusBarHeight + 'px' }"></view>
			<!-- 真正的导航栏内容 -->
			<view class="navBar" style="height: 45px;">
				<slot name="header"></slot>
			</view>
		</view>
		<!-- <view :style="{height:height+'px'}"></view> -->
	</view>
</template>

<script>
	export default {
		props:['type'],
		data() {
			return {
				// 状态栏高度
				statusBarHeight: 0,
				// 导航栏高度
				navBarHeight: 82+11,
				height:0
			};
		},
		//第一次加载时调用
		created() {
			//获取手机状态栏高度
			this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight'];
			this.height=45+this.statusBarHeight
			this.$emit('height',this.height)
		},
	}
</script>

<style>
.navBarBox{position: fixed;z-index: 3; width: 100%;left: 0;top: 0;}
.navBarBox .navBar {
	width: 100%;

}
/* .navBarBox .navBar .logo {
	width: 82rpx;
	height: 82rpx;
	margin-right: 10rpx;
} */
</style>
